package com.stu.mapper;

import com.stu.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserMapper {
    @Select("select * from user")
    @ResultType(User.class)
    List<User> getUsers();
    @Insert("INSERT INTO user VALUES (#{id},#{name},#{pwd})")
    int insertUser(User user);
    @Update("UPDATE user SET name=#{name},pwd=#{pwd} WHERE id=#{id}")
    int updateUser(User user);
    @Delete("DELETE FROM user WHERE id=#{id}")
    int deleteUserById(int id);

    User selectUserById(int id);
}
